﻿using System;

using MonoTorrent.Common;
using MonoTorrent.Client;

namespace SBPweb.RouTorrent.Business
{
    public class DownloadStateChangedEventArgs : EventArgs
    {

        #region Private fields

        private int mUserId;
        private TorrentManager mTorrentInfo;
        private TorrentState mOldState;
        private TorrentState mNewState;

        #endregion

        #region Constructor logic

        public DownloadStateChangedEventArgs(int userId, TorrentManager manager, TorrentStateChangedEventArgs e)
            : this(userId, manager, e.OldState, e.NewState)
        {
        }

        public DownloadStateChangedEventArgs(int userId, TorrentManager manager, TorrentState oldState, TorrentState newState)
        {
            mUserId = userId;
            mTorrentInfo = manager;
            mOldState = oldState;
            mNewState = newState;
        }

        #endregion

        #region Public properties

        public int UserId
        {
            get
            {
                return mUserId;
            }
        }

        public TorrentManager DownloadManager
        {
            get
            {
                return mTorrentInfo;
            }
        }

        public TorrentState OldState
        {
            get
            {
                return mOldState;
            }
        }

        public TorrentState NewState
        {
            get
            {
                return mNewState;
            }
        }

        #endregion

    }

    public delegate void DownloadStateChangedHandler(object sender, DownloadStateChangedEventArgs e);

    /*
    public class DownloadStateChangedEventArgs : EventArgs
    {

        #region Private fields

        private int mPieceNumber;
        private long mPieceLength;
        private int mUserId;
        private TorrentManager mTorrentInfo;

        #endregion

        #region Constructor logic

        public DownloadStateChangedEventArgs(int userId, int pieceNumber, long pieceLength, TorrentManager torrentInfo)
        {
            mUserId = userId;
            mPieceNumber = pieceNumber;
            mPieceLength = pieceLength;
            mTorrentInfo = torrentInfo;
        }

        #endregion

        #region Public properties

        public int PieceNumber
        {
            get
            {
                return mPieceNumber;
            }
        }

        public long PieceLength
        {
            get
            {
                return mPieceLength;
            }
        }

        public int UserId
        {
            get
            {
                return mUserId;
            }
        }

        public TorrentManager Torrent
        {
            get
            {
                return mTorrentInfo;
            }
        }

        #endregion

    }
    */
}